package com.heartline.service;

import com.blade.mvc.annotation.Path;
import com.blade.mvc.annotation.PostRoute;
import com.blade.mvc.http.Request;
import com.blade.mvc.http.Response;
import com.heartline.api.IChannel;
import com.heartline.pojo.RestResponse;
import lombok.extern.slf4j.Slf4j;

import java.io.UnsupportedEncodingException;

/**
 * 爬虫数据接收
 * Created by zhy on 2018/6/14.
 */
@Path("push")
@Slf4j
public class ChannelService implements IChannel {

//    private static final byte[] CALANDAR_TYPE = {0x00, 0x01, 0x00};

    @PostRoute
    @Override
    public RestResponse push(Request req, Response resp) throws UnsupportedEncodingException {
//        String token = req.header("token");
        String body = req.bodyToString();
        log.debug("接收到的数据:{}", body);
        return RestResponse.ok();
    }

    void calandarHandler() {
    }

}
